from langchain_core.runnables import RunnableLambda
from langchain_core.output_parsers import StrOutputParser
from utils import preprocess

def get_chain(prompt, current_llm):
    return (
        prompt
        | current_llm
        | StrOutputParser()
        | RunnableLambda(preprocess)
    )
